package com.wc.AlgoOJ_train.train2_DP训练.c6.DP0304;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/1/13 23:47
 * @description 开会
 * http://43.138.190.70:8888/p/DP0304
 */
public class Main {
    static int maxN = (int) 1e5 + 7;
    static int[] h = new int[maxN];
    static int[] e = new int[maxN << 1];
    static int[] ne = new int[maxN << 1];
    static int[][] dp = new int[maxN][2];
    static int idx;
    static int n;
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) {
        n = sc.nextInt();
        for (int i = 2; i <= n; i++) {
            int u = sc.nextInt();
            int v = i;
            add(u, v);
        }
        dfs(1);
        out.println(dp[1][1]);
        out.flush();
    }

    static void add(int u, int v) {
        e[++idx] = v;
        ne[idx] = h[u];
        h[u] = idx;
    }

    static void dfs(int u) {
        // 自己去嘛
        dp[u][1] = 1;
        for (int i = h[u]; i != 0; i = ne[i]) {
            int v = e[i];
            dfs(v);
            dp[u][0] += dp[v][1];
            dp[u][1] += Math.min(dp[v][0], dp[v][1]);
        }
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }
}